package com.acen.alchol;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.FrameLayout;

public class MeasureAct extends UiAct {
	
	FrameLayout in;
    Button btn_mea_0 , btn_mea_1 , btn_mea_2 ;
	/** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        initLayout();
    }
    
    protected void initLayout() {
    
    	pageID = ID_MEASURE_ACT;
    	
    	super.initLayout();
    	
    	in = (FrameLayout)ll.inflate(R.layout.measure_act_l, null);
    	wrapper.addView(in);
    	
    	btn_mea_0 = (Button)in.findViewById(R.id.btn_mea_0);
        btn_mea_1 = (Button)in.findViewById(R.id.btn_mea_1);
        btn_mea_2 = (Button)in.findViewById(R.id.btn_mea_2);
        btn_mea_0.setOnClickListener(this);
        btn_mea_1.setOnClickListener(this);
        btn_mea_2.setOnClickListener(this);
   
    }
    
    
    public void onClick(View v) {
		super.onClick(v);
		
		switch(v.getId()) {
		case R.id.btn_mea_0:
			if(startTime == null) showDialog(ID_START_DLG);
			else {
				Intent intent_tip_0 = new Intent(MeasureAct.this, ACheckAct.class);
				startActivity(intent_tip_0);
	    		finish();
			}
			break;
		case R.id.btn_mea_1:
			if(startTime == null) showDialog(ID_START_DLG);
			else {
				Intent intent_tip_1 = new Intent(MeasureAct.this, ARecordAct.class);
				startActivity(intent_tip_1);
	    		finish();
			}
			
			break;
		case R.id.btn_mea_2:
    		Intent intent_tip_2 = new Intent(MeasureAct.this, TipAct_0.class);
    		startActivity(intent_tip_2);
    		finish();
			break;
		}
		
		
	}
}

